<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>为什么一定要测试先行呢？</title>
    <meta content="1200" property="og:image:width"/>
    <meta content="630" property="og:image:height"/>
    <link rel="icon" href="../../img/icon.png">
    <link as="font" crossorigin="" href="../../Agrandir-Heavy.2fd076131b76.woff2" rel="preload"
          type="font/woff2"/>
    <link as="font" crossorigin="" href="../../Agrandir-Bold.5adcade67872.woff2" rel="preload"
          type="font/woff2"/>
    <link as="font" crossorigin="" href="../../source-sans-pro-v14-latin-regular.899c8f78ce65.woff2"
          rel="preload" type="font/woff2"/>
    <link as="font" crossorigin="" href="../../Agrandir-Regular.11a4ceb99823.woff2" rel="preload"
          type="font/woff2"/>
    <link as="font" crossorigin="" href="../../source-sans-pro-v14-latin-600.c85615b29630.woff2" rel="preload"
          type="font/woff2"/>
    <link href="../../common.0016184b0568.css" rel="stylesheet" type="text/css"/>
    <link href="../../home.a12d472bcf09.css" rel="stylesheet" type="text/css"/>
    <link href="../content-page.css" rel="stylesheet" type="text/css"/>
</head>
<header class="site-header">
    <br/>
    <h1 style="margin: 0 auto;text-align: left;margin: 0 50px;color: white;font-size: 3.5rem">
        <img src="../../svg/icon-white.svg" height="80" width="80"/>&nbsp;&nbsp;Neil's wiki
        <button class="subscribe" onclick="location.href='../subscribe/index.html'">Subscribe</button>
    </h1>
    <br/>
</header>
<body class="content-body">
<div class="content-body-class">
    <h1 class="hosting-pricing-plan-block__header">为什么一定要测试先行呢？</h1>
    <div class="content-infos">
        <div class="content-words">
            TDD强调测试先行，如果我们已经把tasking做好了，确定了每一个task的scope，我先写代码再写测试，又有什么不适合呢？为什么一定要测试先行？
        </div>
        <div class="content-words">
            首先，tasking帮助我们分离关注点，测试先行更能保证我们开发的时候focus在当前实现，并且快速验证；其次，很多人都会觉得测试不好写，人是一种趋利避害的高等动物，测试先行，会让我们想办法让测试更容易编写，也可以保证我们的代码更易于测试；再者，测试先行会驱动我们提前思考设计，写出来的代码质量更高，坏味道更少；最后，tdd的角度是业务驱动，与整洁架构的业务核心思想天然契合。
        </div>
    </div>
</div>
</body>
</html>
<div class="back-to-home-page">
    <a class="call-to-action__link button" href="/">返回首页</a>
</div>
